package servlet;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.*;
import model.User;
import service.UserService;

import java.io.IOException;
@WebServlet(name="AdminUserEditshowServlet",value = "/AdminUserEditshowServlet")

public class AdminUserEditshowServlet extends HttpServlet {
    private UserService userService =new UserService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int id = Integer.parseInt(request.getParameter("id"));
        User user = userService.selectById(id);
        request.setAttribute("u", user);
//        System.out.println(user+"测试测试");
        request.getRequestDispatcher("UpdateUser.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
